﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Castle.MicroKernel.Registration;
using Castle.Windsor;

namespace RegisterResolveReleasePattern
{
    class Program
    {
        static void Main(string[] args)
        {
            //register
           var  container = new WindsorContainer();
            container.Register(Component.For<IParser>().ImplementedBy<Parser>());
            container.Register(Component.For<IWriter>().ImplementedBy<Writer>());
            container.Register(Component.For<Application>());

            //resolve
            var application = container.Resolve<Application>();
            application.Execute("hel--lo, wor--ld");

            //release
            container.Release(application);
        }
    }
}
